from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.http import HttpResponse
from django.shortcuts import render, redirect

# 公共的步骤筛选器
from myapp.models import *


def get_steps(tool_id, del_filter):
    # 获取全部步骤列表
    all_steps = DB_GM_steps.objects.filter(tool_id=tool_id).order_by("order")
    # 筛选
    res_steps = []
    for i in all_steps:
        if i.filter_id not in del_filter:
            res_steps.append(i)

    return res_steps

